<template>
  <!-- 
   导航栏
   van-nav-bar
        title:中间标题
        left-text:左边文本
        right-text:右边文本
        left-arrow:左边小箭头
        slot="title/left/right"
        @click-left:左边点击
        @click-right:右边点击
   
 -->
  <van-nav-bar
    class="hmNavBar"
    @click-left="$router.push(path)"
    @click-right="$emit('rightClick')"
  >
    <template #title>
      <div class="title">
        {{ title }}
      </div>
    </template>
    <template #left v-if="showIcon">
      <i class="iconfont f44">&#xe637;</i>
    </template>
    <template #right>
      <div class="right" v-if="right">
        {{ right }}
      </div>
    </template>
  </van-nav-bar>
</template>
<script>
export default {
  name: 'hmNavBar',
  // props: ['title', 'path', 'right']
  props: {
    title: {
      type: String
    },
    path: {
      type: String
    },
    right: {
      type: String
    },
    showIcon: {
      type: Boolean,
      default: true
    }
  }
}
</script>
<style lang="less" scoped>
.hmNavBar {
  .title {
    font-size: 18px;
    font-family: PingFangSC, PingFangSC-Semibold;
    font-weight: 600;
    text-align: center;
    color: #222222;
    line-height: 25px;
    letter-spacing: 0px;
  }
  .f44 {
    font-size: 44px;
  }
  ::v-deep .van-nav-bar__left,
  ::v-deep .van-nav-bar__right {
    padding: 0;
  }
  .right {
    padding-right: @p15;
    font-size: 14px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: right;
    color: #181a39;
    line-height: 20px;
    letter-spacing: 0px;
  }
}
</style>
